﻿<%@ Import Namespace="AFI.Speargun.Web.Core" %>
<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<AFI.Speargun.Web.Models.InventoryChecking>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    盘点单 - 新建
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <h2>
        新建</h2>
    <%= Html.ValidationSummary("Create was unsuccessful. Please correct the errors and try again.") %>
    <% using (Html.BeginForm())
       {%>
    <fieldset>
        <legend>盘点单</legend>
        <p>
            <label for="Department">
                部门:</label>
            <%= Html.TextBox("DepartmentAppellation", null, new { @class = "input-box", @size = 50, @readonly = "readonly" })%>
            <%= Html.Hidden("DepartmentId")%>
            <%= Html.ValidationMessage("Department", "*")%>
        </p>
        <p>
            <input type="submit" value="提交" />
        </p>
    </fieldset>
    <% } %>
    <div>
        <%=Html.ActionLink("[返回到列表]", "Index") %>
    </div>

    <script type="text/javascript">
        $(document).ready(function() {
            $.ui.dialog.defaults.bgiframe = true;
            $("#dialogDepartmentSelect").dialog().dialog("close");

            $("#DepartmentAppellation").click(function() {
                $("#dialogDepartmentSelect").dialog().dialog("open");
            });
        });
	</script>

    <div id="dialogDepartmentSelect" title="Department">
        <%
            JQueryTreeView jQueryTreeViewDepartment = new JQueryTreeView();
            jQueryTreeViewDepartment.TreeId = Guid.NewGuid();
            jQueryTreeViewDepartment.TreeController = "Department";
            jQueryTreeViewDepartment.Rules = JQueryTreeViewRule.None;
            Html.RenderPartial("JQueryTreeView", jQueryTreeViewDepartment);
        %>

        <script type="text/javascript">
        function selectCallback_<%=jQueryTreeViewDepartment.TreeId.ToString("N") %>(NODE, TREE_OBJ) {
            $("#DepartmentAppellation").val($(NODE).children("a").text());
            $("#DepartmentId").val($(NODE).attr("id"));
            $("#dialogDepartmentSelect").dialog().dialog("close");
        }
        </script>

    </div>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="LeftContent" runat="server">
</asp:Content>
